package com.ctshk.rpc.order.custom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ctshk.rpc.order.custom.dto.order.CustomOrderTouristOtherFeeDTO;
import com.ctshk.rpc.order.custom.entity.CustomizedOrderTouristOtherFee;
import com.ctshk.rpc.order.custom.vo.TouristCollectionFeeJson;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 游客其他费用 Mapper 接口
 * </p>
 *
 * @author 叶冠峰
 * @since 2021-02-22
 */
public interface CustomizedOrderTouristOtherFeeMapper extends BaseMapper<CustomizedOrderTouristOtherFee> {

    /**
     * 其他费用列表
     * @param touristId
     * @return
     */
    @Select("SELECT *\n" +
            "FROM t_customized_order_tourist_other_fee\n" +
            "WHERE tourist_id = #{tourist_id} AND is_deleted = 0")
    List<CustomOrderTouristOtherFeeDTO> queryByTourist(@Param("tourist_id") Long touristId);

    /**
     * 查询旅客其他费用列表
     * @param touristId
     * @return
     */
    @Select("SELECT fee_name AS projectName,amount AS totalAmount,fee_type AS adjustType\n" +
            "FROM t_customized_order_tourist_other_fee\n" +
            "WHERE tourist_id = #{tourist_id} AND is_deleted = 0")
    List<TouristCollectionFeeJson> selectByTourist(@Param("tourist_id") Long touristId);
}
